select a.EmployeeNumber
from
RD_COMMON.dbo.Star_Employee a
where
a.EmployeeNumber in (select addressnumber from rd_dwcr.dbo.JDEABAddressBookMaster where SearchTypeCode='X')

--delete from RD_COMMON.dbo.Star_Employee where EmployeeNumber not in (select addressnumber from rd_dwcr.dbo.JDEABAddressBookMaster where SearchTypeCode='E')
